<template>
  <div class="app-container">
    <!-- 主应用---流程表达式 -->
    <micro-app
      name="expression"
      :url="url"
      iframe
      style="width: 100%"
      @datachange="expressDataChange"
      @created="created"
      @beforemount="beforemount"
      @mounted="mounted"
      @unmount="unmount"
      @error="expressError"
    ></micro-app>
  </div>
</template>

<script setup name="Online">
const url = ref(import.meta.env.VITE_APP_SUB_CHILD1);

const expressSuccess = ref(true);

function expressDataChange() {
  let expressData = microApp.getData("express");
  // dataForChild2.value = expressData;
  console.log("expressData", expressData);
}

function created() {
  console.log("created");
}
function beforemount() {
  console.log("beforemount");
}
function mounted() {
  console.log("mounted");
}
function unmount() {
  // expressSuccess.value = false;
  console.log("unmount");
}
function expressError() {
  expressSuccess.value = false;
  console.log("子应用加载出错");
}
</script>
